﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace SlidingButtons.Web
{
  public partial class _Default : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }

    protected void btn_Click(object sender, EventArgs e)
    {
      switch (btn.CssClass)
      {
        case "Purple":
          btn.CssClass = "Green";
          break;
        case "Green":
          btn.CssClass = "Red";
          break;
        case "Red":
          btn.CssClass = "FlatGray";
          break;
        case "FlatGray":
          btn.CssClass = "Gray";
          break;
        case "Gray":
          btn.CssClass = "Blue";
          break;
        case "Blue":
          btn.CssClass = "RedTexture";
          break;


        default:
          btn.CssClass = "Purple";
          break;
      }

      btn.Text = getBtnText(btn.CssClass);

    }

    private String getBtnText(String color)
    {
      return "I'm a " + color + " button";
    }
  }
}
